﻿<?php 
require '../../frame/base.php';

$userid = !empty($_REQUEST['userid'])?$_REQUEST['userid']:null;

// 分页
if($_REQUEST['page']!="" && $_REQUEST['pagesize']!=""){
	$de=$_REQUEST['page']*$_REQUEST['pagesize'];
	$size=$_REQUEST['pagesize'];
}else{
	$de=0;
	$size=20;
}
// 分页 end

if($userid){
	$recordScan=$Db->table('scan_record')->field('goodsid,title,images,yuanjia,price')->where('uid',$userid)->order('created_at desc')->limit($de,$size)->select();
	$ary=['uid'=>$userid,'scan'=>$recordScan];
}else{
	$ary=[];
}
echo json_encode(['code'=>200,'msg'=>'成功','data'=>$ary]);

